import 'dart:convert';

BookSearchDto bookSearchDtoFromJson(String str) =>
    BookSearchDto.fromJson(json.decode(str));

String bookSearchDtoToJson(BookSearchDto data) => json.encode(data.toJson());

class BookSearchDto {
  BookSearchDto({
    this.assessmentLevel,
    this.bilingual,
    this.bookCode,
    this.exported,
    this.forAssignment,
    this.interestLevel,
    this.language,
    this.newArrival,
    this.proficiencyLevel,
    this.programKind,
    this.programType,
    this.query,
    this.seriesId,
    this.teacherAssessment,
    this.teacherResource,
    this.textType,
    this.topBook,
    this.topics,
  });

  String? assessmentLevel;
  bool? bilingual;
  String? bookCode;
  bool? exported;
  bool? forAssignment;
  List<String>? interestLevel;
  String? language;
  bool? newArrival;
  List<String>? proficiencyLevel;
  List<String>? programKind;
  List<String>? programType;
  String? query;
  List<String>? seriesId;
  bool? teacherAssessment;
  bool? teacherResource;
  List<String>? textType;
  bool? topBook;
  List<String>? topics;

  factory BookSearchDto.fromJson(Map<String, dynamic> json) => BookSearchDto(
        assessmentLevel: json["assessmentLevel"],
        bilingual: json["bilingual"],
        bookCode: json["bookCode"],
        exported: json["exported"],
        forAssignment: json["forAssignment"],
        interestLevel: json["interestLevel"] != null
            ? List<String>.from(json["interestLevel"].map((x) => x))
            : null,
        language: json["language"],
        newArrival: json["newArrival"],
        proficiencyLevel: json["proficiencyLevel"] != null
            ? List<String>.from(json["proficiencyLevel"].map((x) => x))
            : null,
        programKind: json["programKind"] != null
            ? List<String>.from(json["programKind"].map((x) => x))
            : null,
        programType: json["programType"] != null
            ? List<String>.from(json["programType"].map((x) => x))
            : null,
        query: json["query"],
        seriesId: json["seriesId"] != null
            ? List<String>.from(json["seriesId"].map((x) => x))
            : null,
        teacherAssessment: json["teacherAssessment"],
        teacherResource: json["teacherResource"],
        textType: json["textType"] != null
            ? List<String>.from(json["textType"].map((x) => x))
            : null,
        topBook: json["topBook"],
        topics: json["topics"] != null
            ? List<String>.from(json["topics"].map((x) => x))
            : null,
      );

  Map<String, dynamic> toJson() => {
        "assessmentLevel": assessmentLevel,
        "bilingual": bilingual,
        "bookCode": bookCode,
        "exported": exported,
        "forAssignment": forAssignment,
        "interestLevel": interestLevel != null
            ? List<dynamic>.from(interestLevel!.map((x) => x))
            : null,
        "language": language,
        "newArrival": newArrival,
        "proficiencyLevel": proficiencyLevel != null
            ? List<dynamic>.from(proficiencyLevel!.map((x) => x))
            : null,
        "programKind": programKind != null
            ? List<dynamic>.from(programKind!.map((x) => x))
            : null,
        "programType": programType != null
            ? List<dynamic>.from(programType!.map((x) => x))
            : null,
        "query": query,
        "seriesId": seriesId != null
            ? List<dynamic>.from(seriesId!.map((x) => x))
            : null,
        "teacherAssessment": teacherAssessment,
        "teacherResource": teacherResource,
        "textType": textType != null
            ? List<dynamic>.from(textType!.map((x) => x))
            : null,
        "topBook": topBook,
        "topics":
            topics != null ? List<dynamic>.from(topics!.map((x) => x)) : null,
      };
}
